<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // var num = 10;
        // let num = 10//let 定义不会变量提升，不会变成window下的属性，24行运行结果就是undefined,var定义会将变量提升为window的属性，24行打印就是10
        // let obj = {
        //     num: 20,
        //     run: function () {
        //         console.log(this.num);
        //     },
        // };
        // obj.run();//this是obj
        // let { run } = obj;
        // run()//this是window
        // console.log(num);//打印的是window下的num
        // console.log(obj.num);

        var len = 117
        let func = {
            len: 935,
            showLen: function () {
                console.log(this.len)
            },
            show: function () {
                let _this = this;
                (function (cb) {
                    cb.call(_this)
                })(this.showLen)
            },
        }
        func.show()

    </script>
</body>

</html>